package com.Service;

import com.dao.GameMapper;
import com.entity.Game;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GameService {
    @Autowired
    private GameMapper gameMapper;

    /**
     * 查询
     * @param game
     * @return
     */
    public List<Game> queryGame(Game game){
        return gameMapper.selectAll();
    }

    /**
     * 新增
     * @param game
     * @return
     */
    public int addGame(Game game){
        return gameMapper.insert(game);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    public int delGame(int id){
        return gameMapper.deleteByPrimaryKey(id);
    }

    /**
     * 修改
     * @param game
     * @return
     */
    public int updateGame(Game game){
        return gameMapper.updateByPrimaryKey(game);
    }
}
